package org.echo.io;

import java.io.File;
import java.util.Iterator;

public class FileTest2 {

	static int i;

	public static void findAll(File file) {
		   
		for (int n = 0; n <= i; n++) {
			System.out.print("  ");
		}
		if (file.isFile() || file.list().length == 0) {
			
			System.out.println(" .." + file.getName());

		} 
		else
		 {  
			System.out.println("+.." + file.getName());  
			File[] files = file.listFiles();
			
			for (File f : files) {	
				i++;
				findAll(f);	
				i--;
			}
			
		}

	}
  
	
	public static void main(String[] args) {
     
		File f=new File("E:/TDDOWNLOAD/like other/beautiful");
		findAll(f);
	}
}
